<template>
  <el-form
    label-width="auto"
    label-position="top"
    class="demo-ruleForm"
    style="margin-top: 20px"
  >
    <el-form-item label="九、专家论证意见" />
    <el-form-item label="首段内容">
      <el-input v-model="ruleForm.firstParagraphContent" type="textarea" />
    </el-form-item>
    <el-form-item label="1.立项必要性：">
      <el-input v-model="ruleForm.initiationNecessity" type="textarea" />
    </el-form-item>
    <el-form-item label="2.项目研究目标：">
      <el-input v-model="ruleForm.projectResearchObjectives" type="textarea" />
    </el-form-item>
    <el-form-item label="3.项目研究内容：">
      <el-input v-model="ruleForm.projectResearchContent" type="textarea" />
    </el-form-item>
    <el-form-item label="4.技术经济考核指标：">
      <el-input
        v-model="ruleForm.expertsTechnoeconomicIndicators"
        type="textarea"
      />
    </el-form-item>
    <el-form-item label="5.知识产权考核指标：">
      <el-input
        v-model="ruleForm.expertsIntellectualPropertyIndicators"
        type="textarea"
      />
    </el-form-item>
    <el-form-item label="6. 项目外协合作：">
      <el-input v-model="ruleForm.externalCooperation" type="textarea" />
    </el-form-item>
    <el-form-item label="7.项目研究经费预算">
      <el-input v-model="ruleForm.expertsBudget" type="textarea" />
    </el-form-item>
    <el-form-item label="8.QHSE内容">
      <el-input v-model="ruleForm.expertsQhseContent" type="textarea" />
    </el-form-item>
    <el-form-item label="9.项目研究">
      <el-input v-model="ruleForm.expertsProjectResearch" type="textarea" />
    </el-form-item>
    <el-form-item label="尾段内容">
      <el-input v-model="ruleForm.endParagraphContent" type="textarea" />
    </el-form-item>
  </el-form>
</template>

<script setup>
  const $baseMessage = inject('$baseMessage')

  const ruleForm = reactive({
    initiationNecessity: '',
    projectResearchObjectives: '',
    projectResearchContent: '',
    expertsTechnoeconomicIndicators: '',
    expertsIntellectualPropertyIndicators: '',
    externalCooperation: '',
    expertsBudget: '',
    expertsQhseContent: '',
    expertsProjectResearch: '',
    endParagraphContent: '',
    firstParagraphContent: '',
  })

  const getFormData = () => {
    for (const key in ruleForm) {
      if (!ruleForm[key]) {
        $baseMessage('请填写完整的专家论证意见', 'error')
        return false
      }
    }
    return ruleForm
  }

  const setFormData = ({ baseInfo }) => {
    for (const key in ruleForm) {
      ruleForm[key] = baseInfo[key]
    }
  }

  defineExpose({ getFormData, setFormData })
</script>

<style lang="scss" scoped></style>
